<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script setup>
import { onMounted } from 'vue'
import { useTaskStore } from './stores/taskStore'
import { useSettingsStore } from './stores/settingsStore'

const taskStore = useTaskStore()
const settingsStore = useSettingsStore()

onMounted(() => {
  // 初始化任务存储
  taskStore.initialize()
  
  // 初始化设置存储
  settingsStore.initialize()
})
</script>

<style>
/* 全局样式重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', 'Microsoft YaHei', '微软雅黑', 'PingFang SC', 'Hiragino Sans GB', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.6;
  color: #303133;
  background-color: #f5f5f5;
  overflow-x: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 应用容器 */
#app {
  min-height: 100vh;
  background: #f5f5f5;
  position: relative;
}

/* Element Plus 组件样式优化 */
.el-button {
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.el-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.el-button--primary {
  background: #409eff;
  border: none;
  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
}

.el-button--primary:hover {
  background: #66b1ff;
  box-shadow: 0 4px 16px rgba(64, 158, 255, 0.4);
}

.el-button--success {
  background: #67c23a;
  border: none;
  box-shadow: 0 2px 8px rgba(103, 194, 58, 0.3);
}

.el-button--success:hover {
  background: #85ce61;
  box-shadow: 0 4px 16px rgba(103, 194, 58, 0.4);
}

.el-button--warning {
  background: #e6a23c;
  border: none;
  box-shadow: 0 2px 8px rgba(230, 162, 60, 0.3);
}

.el-button--warning:hover {
  background: #ebb563;
  box-shadow: 0 4px 16px rgba(230, 162, 60, 0.4);
}

.el-button--danger {
  background: #f56c6c;
  border: none;
  box-shadow: 0 2px 8px rgba(245, 108, 108, 0.3);
}

.el-button--danger:hover {
  background: #f78989;
  box-shadow: 0 4px 16px rgba(245, 108, 108, 0.4);
}

.el-button--info {
  background: #909399;
  border: none;
  box-shadow: 0 2px 8px rgba(144, 147, 153, 0.3);
}

.el-button--info:hover {
  background: #a6a9ad;
  box-shadow: 0 4px 16px rgba(144, 147, 153, 0.4);
}

/* 卡片样式优化 */
.el-card {
  border-radius: 12px;
  border: 1px solid #e4e7ed;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.el-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.el-card__header {
  background: #fafafa;
  border-bottom: 1px solid #e4e7ed;
  padding: 20px 24px;
}

.el-card__body {
  padding: 24px;
}

/* 表格样式优化 */
.el-table {
  border-radius: 8px;
  overflow: hidden;
}

.el-table__header {
  background: #fafafa;
}

.el-table__header th {
  background: #fafafa;
  border-bottom: 1px solid #e4e7ed;
  color: #606266;
  font-weight: 600;
  font-size: 14px;
}

.el-table__row {
  transition: all 0.3s;
}

.el-table__row:hover {
  background: #f5f7fa;
}

/* 标签样式优化 */
.el-tag {
  border-radius: 6px;
  font-weight: 500;
  border: none;
}

.el-tag--success {
  background: #67c23a;
  color: #ffffff;
}

.el-tag--warning {
  background: #e6a23c;
  color: #ffffff;
}

.el-tag--danger {
  background: #f56c6c;
  color: #ffffff;
}

.el-tag--info {
  background: #909399;
  color: #ffffff;
}

.el-tag--primary {
  background: #409eff;
  color: #ffffff;
}

/* 进度条样式优化 */
.el-progress-bar__outer {
  background: #f0f2f5;
  border-radius: 4px;
}

.el-progress-bar__inner {
  border-radius: 4px;
  transition: all 0.3s;
}

/* 输入框样式优化 */
.el-input__wrapper {
  background: #fafafa;
  border: 1px solid #e4e7ed;
  border-radius: 6px;
  transition: all 0.3s;
}

.el-input__wrapper:hover {
  border-color: #c0c4cc;
}

.el-input__wrapper.is-focus {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* 选择器样式优化 */
.el-select .el-input__wrapper {
  background: #fafafa;
}

/* 开关样式优化 */
.el-switch__core {
  border-radius: 12px;
}

/* 分页样式优化 */
.el-pagination {
  text-align: center;
  margin-top: 20px;
}

.el-pagination .el-pager li {
  border-radius: 6px;
  transition: all 0.3s;
}

.el-pagination .el-pager li:hover {
  background: #f0f2f5;
  color: #409eff;
}

.el-pagination .el-pager li.is-active {
  background: #409eff;
  color: #ffffff;
}

/* 对话框样式优化 */
.el-dialog {
  border-radius: 12px;
  overflow: hidden;
}

.el-dialog__header {
  background: #fafafa;
  border-bottom: 1px solid #e4e7ed;
  padding: 20px 24px;
}

.el-dialog__body {
  padding: 24px;
}

.el-dialog__footer {
  background: #fafafa;
  border-top: 1px solid #e4e7ed;
  padding: 20px 24px;
}

/* 消息提示样式优化 */
.el-message {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.el-message--success {
  background: #67c23a;
  border: none;
  color: #ffffff;
}

.el-message--warning {
  background: #e6a23c;
  border: none;
  color: #ffffff;
}

.el-message--error {
  background: #f56c6c;
  border: none;
  color: #ffffff;
}

.el-message--info {
  background: #909399;
  border: none;
  color: #ffffff;
}

/* 加载状态样式 */
.el-loading-mask {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
}

/* 空状态样式 */
.el-empty {
  padding: 40px 20px;
}

.el-empty__description {
  color: #909399;
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  html, body {
    font-size: 13px;
  }
  
  .el-card__header {
    padding: 16px 20px;
  }
  
  .el-card__body {
    padding: 20px;
  }
  
  .el-dialog__header {
    padding: 16px 20px;
  }
  
  .el-dialog__body {
    padding: 20px;
  }
  
  .el-dialog__footer {
    padding: 16px 20px;
  }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
  html, body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }
  
  #app {
    background: #1a1a1a;
  }
  
  .el-card {
    background: #2d2d2d;
    border-color: #404040;
  }
  
  .el-card__header {
    background: #333333;
    border-color: #404040;
  }
  
  .el-table__header {
    background: #333333;
  }
  
  .el-table__header th {
    background: #333333;
    border-color: #404040;
    color: #e0e0e0;
  }
  
  .el-input__wrapper {
    background: #333333;
    border-color: #404040;
  }
  
  .el-dialog {
    background: #2d2d2d;
  }
  
  .el-dialog__header {
    background: #333333;
    border-color: #404040;
  }
  
  .el-dialog__footer {
    background: #333333;
    border-color: #404040;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 应用动画类 */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

.scale-in {
  animation: scaleIn 0.3s ease-out;
}

/* 工具提示样式 */
.el-tooltip__popper {
  border-radius: 6px;
  font-size: 12px;
}

/* 徽章样式 */
.el-badge__content {
  border-radius: 10px;
  font-weight: 600;
}

/* 下拉菜单样式 */
.el-dropdown-menu {
  border-radius: 8px;
  border: 1px solid #e4e7ed;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.el-dropdown-menu__item {
  border-radius: 4px;
  margin: 2px 8px;
  transition: all 0.3s;
}

.el-dropdown-menu__item:hover {
  background: #f5f7fa;
  color: #409eff;
}

/* 时间选择器样式 */
.el-date-picker {
  border-radius: 8px;
  border: 1px solid #e4e7ed;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 级联选择器样式 */
.el-cascader {
  border-radius: 6px;
}

/* 树形控件样式 */
.el-tree {
  background: transparent;
}

.el-tree-node__content {
  border-radius: 4px;
  transition: all 0.3s;
}

.el-tree-node__content:hover {
  background: #f5f7fa;
}

/* 步骤条样式 */
.el-steps {
  margin: 20px 0;
}

.el-step__title {
  font-weight: 600;
}

.el-step__icon {
  border-radius: 50%;
}

/* 标签页样式 */
.el-tabs__header {
  border-bottom: 1px solid #e4e7ed;
}

.el-tabs__item {
  border-radius: 6px 6px 0 0;
  transition: all 0.3s;
}

.el-tabs__item:hover {
  color: #409eff;
}

.el-tabs__item.is-active {
  color: #409eff;
  font-weight: 600;
}

.el-tabs__active-bar {
  background: #409eff;
  height: 3px;
  border-radius: 2px;
}
</style> 